<template>
	<view>
		<view class="box auto mb20" @click="goDetails(item)">
			<!-- 第一行 -->
			<view class="pl30 pt30 dflex alc pr50 jcsb">
				<view class="dflex alc">
					<view class="fs32 fw900 color">{{ item.name }}({{ getSum }}人)</view>

					<image
						src="../../static/black-right.png"
						mode="heightFix"
						style="width: 30rpx;height: 30rpx;vertical-align: middle;"
						class="mt8 ml10"
					></image>
				</view>
				<image
					class="status fs24 textc"
					src="../../static/shz.png"
					mode="heightFix"
					v-if="item.status == 0"
				></image>
				<image
					class="status fs24 textc"
					src="../../static/shcg.png"
					v-if="item.status == 1"
					mode="heightFix"
				></image>
				<image
					class="status fs24 textc"
					src="../../static/shsb.png"
					v-if="item.status == 2"
					mode="heightFix"
				></image>
			</view>
			<!-- 第二行 -->
			<view class="dflex flexw pt30">
				<view
					class="dflex flexc alc jcc mb42"
					style="width: 33.33%;"
					v-for="(itm, index) in item.schoolList"
				>
					<view class="fs36 fw900 colora">{{ itm.num }}</view>
					<view class="mt12 fs28 gray">{{ itm.classes }}</view>
				</view>
			</view>
			<view class="pb30 fs28 gray" style="padding-left: 80rpx;">提交时间:{{ item.time }}</view>
			<view
				v-if="item.status == 2"
				class="pb30 fs28 gray"
				style="padding-left: 80rpx;color: #E62D32;"
			>
				失败原因:{{ item.reason }}
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: ['item'],
	computed: {
		//计算学校的总人数
		getSum() {
			return this.item.schoolList.reduce((sum, el) => {
				return sum + el.num;
			}, 0);
		}
	},
	methods: {
		goDetails(item) {
			this.$emit('handerDetails', item);
		}
	}
};
</script>

<style scoped lang="scss">
.box {
	width: 690rpx;

	background: #ffffff;
	border-radius: 20rpx 20rpx 20rpx 20rpx;
	opacity: 1;
}
.status {
	width: 88rpx;
	height: 34rpx;
}
.success {
	width: 112rpx;
	height: 34rpx;
}
.err {
	width: 112rpx;
	height: 34rpx;
}
</style>
